package com.huike.clues.service.impl;


import com.huike.clues.domain.TbClue;
import com.huike.clues.domain.TbClueTrackRecord;
import com.huike.clues.mapper.TbClueMapper;
import com.huike.clues.mapper.TbClueTrackRecordMapper;
import com.huike.clues.service.ITbClueTrackRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 线索跟进记录Service业务层处理
 * @date 2022-04-22
 */
@Service
public class TbClueTrackRecordServiceImpl implements ITbClueTrackRecordService {

    @Autowired
    private TbClueMapper tbClueMapper;

    @Autowired
    private TbClueTrackRecordMapper clueTrackRecordMapper;

    /**
     * 线索跟进记录添加
     * @param tbClueTrackRecord 线索跟进记录列表
     */
    @Override
    public int insertTbClueTrackRecord(TbClue tbClue, TbClueTrackRecord trackRecord) {
        tbClueMapper.updateTbClue(tbClue);
        //2.保存跟进记录
        return clueTrackRecordMapper.insertTbClueTrackRecord(trackRecord);
    }


    /**
     * 查询线索跟进记录列表
     * @param clueId 线索id
     * @return 线索跟进记录列表
     */
    @Override
    public List<TbClueTrackRecord> selectTbClueTrackRecordList(Long clueId) {
        return clueTrackRecordMapper.selectTbClueTrackRecordListByClueId(clueId);
    }


}




























